package com.zy.composeworld.base

import android.os.Bundle
import android.view.LayoutInflater
import android.view.ViewGroup
import android.view.View
import androidx.fragment.app.Fragment
import com.zy.composeworld.utils.ZLog

abstract class BaseFragment : Fragment() {
    companion object {
        const val TAG = "BaseFragment"
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        ZLog.d(TAG, "onCreate:$this")
    }

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        ZLog.d(TAG, "onCreateView(return):$this")
        return super.onCreateView(inflater, container, savedInstanceState)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        ZLog.d(TAG, "onCreateView:$this")
    }

    override fun onStart() {
        super.onStart()
        //ZLog.d(TAG, "onStart:$this ${Throwable().printStackTrace()}")
    }

    override fun onResume() {
        super.onResume()
        ZLog.d(TAG, "onResume:$this")
    }

    override fun onPause() {
        super.onPause()
        ZLog.d(TAG, "onPause:$this")
    }

    override fun onStop() {
        super.onStop()
        ZLog.d(TAG, "onStop:$this")
    }

    override fun onDestroy() {
        super.onDestroy()
        ZLog.d(TAG, "onDestroy:$this")
    }
}
